{template 'common/header'}
	<div class="panel panel-info">
		<div class="panel-heading">筛选</div>
		<div class="panel-body">
			<form action="./index.php" method="get" class="form-horizontal" role="form">
			<input type="hidden" name="c" value="platform">
			<input type="hidden" name="a" value="stat">
			<input type="hidden" name="do" value="history">
			<input type="hidden" name="searchtype" value="{$_GPC['searchtype']}">
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">规则类型</label>
					<div class="col-sm-8 col-lg-9 col-xs-12">
						<div class="btn-group">
							<a href="{php echo filter_url('searchtype:');}"  class="btn {if $_GPC['searchtype'] == ''}btn-primary{else}btn-default{/if}">不限</a>
							<a href="{php echo filter_url('searchtype:rule');}"  class="btn {if $_GPC['searchtype']== 'rule'}btn-primary{else}btn-default{/if}">已有规则回复</a>
							<a href="{php echo filter_url('searchtype:default');}"  class="btn {if $_GPC['searchtype'] == 'default'}btn-primary{else}btn-default{/if}">默认规则回复</a>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">内容关键字</label>
					<div class="col-sm-6 col-lg-8 col-xs-12" >
						<input type="text" name="keyword" class="form-control" value="{$_GPC['keyword']}" placeholder="请输入内容关键字">
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">日期范围</label>
					<div class="col-sm-6 col-xs-12 col-lg-8 col-xs-12">
						{php echo tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d', $starttime),'endtime'=>date('Y-m-d', $endtime)));}
					</div>
					<div class="pull-right col-xs-12 col-sm-3 col-lg-2">
						<input type="submit" class="btn btn-default" name="export" value="导出">
						<input type="hidden" name="token" value="{$_W['token']}">
						<button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
					</div>
				</div>
			</form>
		</div>
	</div>
	<div class="panel panel-default">
		<div class="panel-heading">
			详细数据
		</div>
		<div class="table-responsive panel-body">
			<table class="table table-hover">
				<thead>
					<tr>
						<th style="width:10%;">用户</th>
						<th style="width:20%;">内容</th>
						<th style="width:20%;">规则</th>
						<th style="width:20%;">模块</th>
						<th style="width:20%;">时间</th>
						<th style="width:10%;">操作</th>
					</tr>
				</thead>
				<tbody>
					{loop $list $row}
					<tr>
						<td>
							<a href="#" title="{$row['from_user']}">{php echo cutstr($row['from_user'], 8, '.')}</a>
						</td>
						<td align="left" class="row-hover wexin-image">
							<div style="max-width:515px; overflow:hidden; word-break:break-all; word-wrap:break-word;">{$row['message']}</div>
						</td>
						<td>
							{if empty($row['rid']) && $row['module']}
								该消息由<span class="text-danger">{$row['module']}</span>模块直接处理
							{elseif $row['rid']}
								<a target="main" href="{$rules[$row['rid']]['url']}">{php echo cutstr($rules[$row['rid']]['name'], 6)}</a>
							{else}
								未触发规则
							{/if}
						</td>
						<td>
							{if $row['module'] == 'default'}
								没有回复规则,由<span class="text-danger">default</span>模块处理
							{else}
								{if $rules[$row['rid']]['module']}
									{$rules[$row['rid']]['module']}
								{elseif $row['module']}
									{$row['module']}
								{else}
									未触发模块
								{/if}
							{/if}
						</td>
						<td style="font-size:12px; color:#666;">
							{php echo date('Y-m-d <br /> H:i:s', $row[createtime]);}
						</td>
						<td>
							<a href="{php echo url('platform/stat/del', array('op' => 'history', 'id' => $row['id']))}" onclick="return confirm('删除后不能恢复，您确定删除吗？')">删除</a>
						</td>
					</tr>
					{/loop}
				</tbody>
			</table>
		</div>
	</div>
{$pager}
{template 'common/footer'}
